package org.hardstone.domain.computer.resource;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import org.hardstone.domain.BaseCategory;
import org.hardstone.domain.BaseItemDomain;
import org.hardstone.domain.Status;

@Entity
@Table(name = "Memory")
public class Memory extends BaseItemDomain<Long> {

    @Column(name = "memory")
    protected Long memory;                    //Memory capacity @Mb

    @Column(name = "usedCapacity")
    protected Long usedCapacity;              //Used Memory capacity @Mb

    @Column(name = "usefulCapacity")
    protected Long usefulCapacity;            //unUsed Memory capacity @Mb

    @Column(name = "usageRate")
    protected Float usageRate;                 //usage rate @%

    @Column(name = "memorySpecification")
    protected String memorySpecification;    //DDR3 DDR4 DDR5..

    @Column(name = "clockFrequency")
    protected Long clockFrequency;             //Memory clock frequency @Hz

    @Column(name = "speed")
    protected Long speed;                      //Write and read speed @Mb/s

    @Column(name = "duration")
    protected Long duration;                  //Time for sign

    public Memory() {
        super();
        this.usageRate = (Float) 0.0F;
        this.memorySpecification = "0F";
    }

    public Memory(Long itemGroupId, String name, BaseCategory baseCategory, Long userId, Long userGroupId, int authority, String url, String description, Status status, String askDate, String modifyDate, String tags, String attribute) {
        super(itemGroupId, name, baseCategory, userId, userGroupId, authority, url, description, status, askDate, modifyDate, tags, attribute);
    }

    public Memory(Long itemGroupId, String name, BaseCategory baseCategory, Long userId, Long userGroupId, int authority, String url, String description, Status status, String askDate, String modifyDate, String tags, String attribute, Long memory, Long usedCapacity, Long usefulCapacity, Float usageRate, String memorySpecification, Long clockFrequency, Long speed, Long duration) {
        super(itemGroupId, name, baseCategory, userId, userGroupId, authority, url, description, status, askDate, modifyDate, tags, attribute);
        this.memory = memory;
        this.usedCapacity = usedCapacity;
        this.usefulCapacity = usefulCapacity;
        this.usageRate = usageRate;
        this.memorySpecification = memorySpecification;
        this.clockFrequency = clockFrequency;
        this.speed = speed;
        this.duration = duration;
    }

    public Memory(Long id, Long itemGroupId, String name, BaseCategory category, Long userId, Long userGroupId, int authority, String url, String description, Status status, String askDate, String modifyDate, String tags, String attribute, Long memory, Long usedCapacity, Long usefulCapacity, Float usageRate, String memorySpecification, Long clockFrequency, Long speed, Long duration) {
        super(id, itemGroupId, name, category, userId, userGroupId, authority, url, description, status, askDate, modifyDate, tags, attribute);
        this.memory = memory;
        this.usedCapacity = usedCapacity;
        this.usefulCapacity = usefulCapacity;
        this.usageRate = usageRate;
        this.memorySpecification = memorySpecification;
        this.clockFrequency = clockFrequency;
        this.speed = speed;
        this.duration = duration;
    }


    public Long getMemory() {
        return memory;
    }

    public void setMemory(Long memory) {
        this.memory = memory;
    }

    public Long getUsedCapacity() {
        return usedCapacity;
    }

    public void setUsedCapacity(Long usedCapacity) {
        this.usedCapacity = usedCapacity;
    }

    public Long getUsefulCapacity() {
        return usefulCapacity;
    }

    public void setUsefulCapacity(Long usefulCapacity) {
        this.usefulCapacity = usefulCapacity;
    }

    public Float getUsageRate() {
        return usageRate;
    }

    public void setUsageRate(Float usageRate) {
        this.usageRate = usageRate;
    }

    public String getMemorySpecification() {
        return memorySpecification;
    }

    public void setMemorySpecification(String memorySpecification) {
        this.memorySpecification = memorySpecification;
    }

    public Long getClockFrequency() {
        return clockFrequency;
    }

    public void setClockFrequency(Long clockFrequency) {
        this.clockFrequency = clockFrequency;
    }

    public Long getSpeed() {
        return speed;
    }

    public void setSpeed(Long speed) {
        this.speed = speed;
    }

    public Long getDuration() {
        return duration;
    }

    public void setDuration(Long duration) {
        this.duration = duration;
    }

    @Override
    public String toString() {
        return "Memory{" +
                "memory=" + memory +
                ", usedCapacity=" + usedCapacity +
                ", usefulCapacity=" + usefulCapacity +
                ", usageRate=" + usageRate +
                ", memorySpecification='" + memorySpecification + '\'' +
                ", clockFrequency=" + clockFrequency +
                ", speed=" + speed +
                ", duration=" + duration +
                ", id=" + id +
                ", itemGroupId=" + itemGroupId +
                ", name='" + name + '\'' +
                ", baseCategory=" + baseCategory +
                ", userId=" + userId +
                ", userGroupId=" + userGroupId +
                ", authority=" + authority +
                ", url='" + url + '\'' +
                ", description='" + description + '\'' +
                ", status=" + status +
                ", askDate='" + askDate + '\'' +
                ", modifyDate='" + modifyDate + '\'' +
                ", tags='" + tags + '\'' +
                ", attribute='" + attribute + '\'' +
                '}';
    }
}
